/*  File Name	: TimeValue.h
 *  Author		: Pang Jiacai
 *	 E-mail		: 823960168@qq.com
 *  Created on	: 2012-6-27
 *  Description:
 */

#ifndef TIMEVALUE_H_
#define TIMEVALUE_H_
#include <sys/time.h>
#include <string>
class TimeValue
{
public:
	TimeValue(int sec=0,int msec=0);

	virtual ~TimeValue();

    static unsigned long now_time_in_msec(void);

    static unsigned long now_time_in_sec(void);

    static std::string now_time_str_sec(void);

	void sec(unsigned long sec);

	unsigned long sec(void) const;

	void msec(unsigned long msec);

	unsigned long msec(void) const;

	void set(int sec,int msec);

	TimeValue &operator=(const TimeValue &tv);

//	friend bool &operator==(const TimeValue &t1,const TimeValue &t2);
//
//	friend bool &operator >(const TimeValue &t1,const TimeValue &t2);
//
//	friend bool &operator >=(const TimeValue &t1,const TimeValue &t2);

public:
	static const TimeValue zero;

private:

	long int sec_;

	long int msec_;

	//timeval time_val_;
};

#endif /* TIMEVALUE_H_ */
